package homework01;

public class homework011 {
	public static void main(String[] args) {
		int[] arr={4,1,6,3,9,8};
		int[] arr1=copyArrRange(arr,2,4);
		for(int i=0;i<arr1.length;i++){
			System.out.println(arr1[i]);
		}
	}
	public static int[] copyArrRange(int[] arr, int from, int to){
		int len=(to-from)+1;
		int[] newArr = new int[len];
		int j=0;
		for (int i=from;i <=to;i++){
			newArr[j]=arr[i];
			j++;
		}
		return newArr;
	}
}
